home *** CD-ROM | disk | FTP | other *** search
/ Space & Astronomy / Space and Astronomy (October 1993).iso / pc / programs / mac / almanac.sit / Almanac v1.8 / background_2765.txt < prev    next >
Text File  |  1990-04-21  |  13KB  |  643 lines

  1. -- background: 2765 from stack: in.8
  2. -- bmap block id: 4019
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: almanac
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global force,total,dec,dra,decra,fac,h,m,mode,t
  9.   put line 1 of cd fld "Coords" of cd origin into lat
  10.   ST
  11.   put line 2 of fld UT into oldUT
  12.   UT
  13.   if total then
  14.     get char 30 to 33 of line 3 of cd fld "totalOcc" of cd "Moon"
  15.     if it is empty then
  16.       set textstyle of fld pct to bold,italic
  17.     else
  18.       set textstyle of fld pct to bold
  19.       put char 1 to 3 of it &"%"& last char of it into fld pct
  20.     end if
  21.   end if
  22.   JD
  23.   set numberFormat to "0.#######"
  24.   if the shiftKey is up then
  25.     get the number of this cd
  26.     -- change 10 to 11 for Neptune
  27.     if it>1 and it<11 then
  28.       calc (the number of words of fld "ra cheb"),force
  29.     end if
  30.   end if
  31.   if the short name of this cd is "Moon" or the short name of this cd is "Jupiter" then
  32.     put nDate(1,12,0) &&"(JT)" into fld "date"
  33.     if the short name of this cd is "Moon" then
  34.       if total then
  35.         send mouseUp to cd btn "Today"
  36.       end if
  37.     else
  38.       send JFetch to cd Jupiter
  39.     end if
  40.   else
  41.     put nDate(0,0,0) into fld "date"
  42.   end if
  43.   if short name of this cd is "Moon" and (the date Γëá line 6 of fld rise or force) then
  44.     -- moon calcs from A.A.
  45.     put the date into line 6 of fld rise
  46.     put trunc(the seconds/86400)+(line 4 of fld "Rise")/24 + 2416480.5 + DSTcheck()/24 into JDr
  47.     put (JDr-2451545)/36525 into t
  48.     moonpos
  49.     get -sind(lat)*sind(dec)/cosd(lat)/cosd(dec)
  50.     put atan(sqrt(1-it*it)/it) into ang
  51.     put dec>0 into d1
  52.     put lat>0 into d2
  53.     if d1 is d2 then
  54.       add pi to ang
  55.     end if
  56.     put ang/fac/15 into delta
  57.     put dra/15+line 2 of fld UT-line 2 of fld ST+24-DSTcheck()into arg
  58.     get (arg-delta) mod 24
  59.     put arg into line 3 of fld rise
  60.     put it into line 4 of fld rise
  61.     hm false,it
  62.     ampm
  63.     put short name of this cd && "Rises at "& h &":" & m && mode into line 1 of fld rise
  64.     put trunc(the seconds/86400)+(line 5 of fld "Rise")/24 + 2416480.5 + DSTcheck()/24 into JDs
  65.     put (JDs-2451545)/36525 into t
  66.     moonpos
  67.     get -sind(lat)*sind(dec)/cosd(lat)/cosd(dec)
  68.     put atan(sqrt(1-it*it)/it) into ang
  69.     put dec>0 into d1
  70.     put lat>0 into d2
  71.     if d1 is d2 then
  72.       add pi to ang
  73.     end if
  74.     put ang/fac/15 into delta
  75.     put dra/15+line 2 of fld UT-line 2 of fld ST+24-DSTcheck()into arg
  76.     get (arg+delta) mod 24
  77.     put it into line 5 of fld rise
  78.     hm false,it
  79.     ampm
  80.     put short name of this cd && "Sets  at "& h &":" & m && mode into line 2 of fld rise
  81.   end if
  82. end openCard
  83.  
  84. on JD
  85.   set numberFormat to "0.###"
  86.   put "Julian Date = " & the seconds/86400 + 2416480.5 + DSTcheck()/24 into fld "JD"
  87. end JD
  88.  
  89. on effect
  90.   visual effect wipe left very fast
  91. end effect
  92.  
  93. -- three scripts below are for adding new year stuff
  94. on dc
  95.   global fieldName,n
  96.   repeat with i=1 to n
  97.     if "." is not in word i of fld fieldName then
  98.       put i&&word i of fld fieldName
  99.       exit repeat
  100.     end if
  101.   end repeat
  102. end dc
  103.  
  104. on NeuJahr
  105.   global fieldName,n
  106.   put 0 into i
  107.   Answer "Field" with "RA Cheb" or "Dec Cheb"
  108.   put it into fieldName
  109.   put fieldName
  110.   put empty into  fld fieldName
  111.   repeat
  112.     add 1 to i
  113.     Ask "Enter Term"&&i
  114.     if it is empty then
  115.       put i-1 into n
  116.       exit repeat
  117.     end if
  118.     put it&" " into word i of  fld fieldName
  119.   end repeat
  120.   addit
  121. end NeuJahr
  122.  
  123. on addit
  124.   Answer "Field" with "RA Cheb" or "Dec Cheb"
  125.   put it into fieldName
  126.   put 0 into sum
  127.   set numberFormat to "0.000000000"
  128.   repeat with i=1 to number of words of fld FieldName
  129.     add word i of fld fieldName to sum
  130.   end repeat
  131.   put sum
  132. end addit
  133.  
  134.  
  135.  
  136. -- part 1 (button)
  137. -- low flags: 00
  138. -- high flags: C006
  139. -- rect: left=354 top=281 right=303 bottom=398
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 1
  143. -- font id: 0
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: DST
  148. ----- HyperTalk script -----
  149. on mouseUp
  150.   set hilite of me to not hilite of me
  151. end mouseUp
  152.  
  153.  
  154.  
  155. -- part 4 (button)
  156. -- low flags: 00
  157. -- high flags: 0000
  158. -- rect: left=432 top=50 right=92 bottom=471
  159. -- title width / last selected line: 0
  160. -- icon id / first selected line: 20098 / 20098
  161. -- text alignment: 1
  162. -- font id: 0
  163. -- text size: 12
  164. -- style flags: 0
  165. -- line height: 16
  166. -- part name: Home
  167. ----- HyperTalk script -----
  168. on mouseUp
  169.   effect
  170.   go home
  171. end mouseUp
  172.  
  173.  
  174.  
  175. -- part 5 (button)
  176. -- low flags: 00
  177. -- high flags: 0000
  178. -- rect: left=432 top=91 right=121 bottom=471
  179. -- title width / last selected line: 0
  180. -- icon id / first selected line: 16732 / 16732
  181. -- text alignment: 1
  182. -- font id: 0
  183. -- text size: 12
  184. -- style flags: 0
  185. -- line height: 16
  186. -- part name: 
  187. ----- HyperTalk script -----
  188. on mouseUp
  189.   effect
  190.   push card
  191.   go card "fx"
  192. end mouseUp
  193.  
  194.  
  195.  
  196.  
  197. -- part 6 (field)
  198. -- low flags: 00
  199. -- high flags: 0000
  200. -- rect: left=190 top=283 right=301 bottom=349
  201. -- title width / last selected line: 0
  202. -- icon id / first selected line: 0 / 0
  203. -- text alignment: 0
  204. -- font id: 0
  205. -- text size: 12
  206. -- style flags: 0
  207. -- line height: 16
  208. -- part name: UT
  209.  
  210.  
  211. -- part 7 (field)
  212. -- low flags: 00
  213. -- high flags: 0000
  214. -- rect: left=38 top=283 right=301 bottom=186
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 0 / 0
  217. -- text alignment: 0
  218. -- font id: 0
  219. -- text size: 12
  220. -- style flags: 0
  221. -- line height: 16
  222. -- part name: ST
  223.  
  224.  
  225. -- part 8 (field)
  226. -- low flags: 81
  227. -- high flags: 4001
  228. -- rect: left=0 top=171 right=236 bottom=512
  229. -- title width / last selected line: 0
  230. -- icon id / first selected line: 0 / 0
  231. -- text alignment: 0
  232. -- font id: 15026
  233. -- text size: 10
  234. -- style flags: 0
  235. -- line height: 13
  236. -- part name: RA Cheb
  237.  
  238.  
  239. -- part 9 (field)
  240. -- low flags: 81
  241. -- high flags: 4001
  242. -- rect: left=0 top=275 right=342 bottom=511
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 0
  246. -- font id: 15026
  247. -- text size: 10
  248. -- style flags: 0
  249. -- line height: 13
  250. -- part name: dec Cheb
  251.  
  252.  
  253. -- part 10 (field)
  254. -- low flags: 00
  255. -- high flags: 0000
  256. -- rect: left=181 top=75 right=141 bottom=363
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 0 / 0
  259. -- text alignment: 0
  260. -- font id: 0
  261. -- text size: 12
  262. -- style flags: 0
  263. -- line height: 16
  264. -- part name: Pos
  265.  
  266.  
  267. -- part 13 (field)
  268. -- low flags: 00
  269. -- high flags: 0000
  270. -- rect: left=181 top=140 right=175 bottom=363
  271. -- title width / last selected line: 0
  272. -- icon id / first selected line: 0 / 0
  273. -- text alignment: 0
  274. -- font id: 0
  275. -- text size: 12
  276. -- style flags: 0
  277. -- line height: 16
  278. -- part name: rise
  279.  
  280.  
  281. -- part 14 (field)
  282. -- low flags: 00
  283. -- high flags: 0000
  284. -- rect: left=41 top=81 right=106 bottom=170
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 0
  288. -- font id: 14991
  289. -- text size: 18
  290. -- style flags: 0
  291. -- line height: 24
  292. -- part name: Planet
  293.  
  294.  
  295. -- part 17 (button)
  296. -- low flags: 00
  297. -- high flags: 0000
  298. -- rect: left=398 top=50 right=83 bottom=433
  299. -- title width / last selected line: 0
  300. -- icon id / first selected line: 100 / 100
  301. -- text alignment: 1
  302. -- font id: 0
  303. -- text size: 12
  304. -- style flags: 0
  305. -- line height: 16
  306. -- part name: Sun
  307. ----- HyperTalk script -----
  308. on mouseUp
  309.   effect
  310.   go card "Sun"
  311. end mouseUp
  312.  
  313.  
  314.  
  315.  
  316. -- part 18 (button)
  317. -- low flags: 00
  318. -- high flags: 0000
  319. -- rect: left=398 top=82 right=115 bottom=433
  320. -- title width / last selected line: 0
  321. -- icon id / first selected line: 101 / 101
  322. -- text alignment: 1
  323. -- font id: 0
  324. -- text size: 12
  325. -- style flags: 0
  326. -- line height: 16
  327. -- part name: 
  328. ----- HyperTalk script -----
  329. on mouseUp
  330.   effect
  331.   go card "Mercury"
  332. end mouseUp
  333.  
  334.  
  335.  
  336.  
  337. -- part 19 (button)
  338. -- low flags: 00
  339. -- high flags: 0000
  340. -- rect: left=398 top=114 right=147 bottom=433
  341. -- title width / last selected line: 0
  342. -- icon id / first selected line: 102 / 102
  343. -- text alignment: 1
  344. -- font id: 0
  345. -- text size: 12
  346. -- style flags: 0
  347. -- line height: 16
  348. -- part name: 
  349. ----- HyperTalk script -----
  350. on mouseUp
  351.   effect
  352.   go card "Venus"
  353. end mouseUp
  354.  
  355.  
  356.  
  357.  
  358. -- part 20 (button)
  359. -- low flags: 00
  360. -- high flags: 0000
  361. -- rect: left=398 top=146 right=179 bottom=433
  362. -- title width / last selected line: 0
  363. -- icon id / first selected line: 104 / 104
  364. -- text alignment: 1
  365. -- font id: 0
  366. -- text size: 12
  367. -- style flags: 0
  368. -- line height: 16
  369. -- part name: 
  370. ----- HyperTalk script -----
  371. on mouseUp
  372.   effect
  373.   go card "Mars"
  374. end mouseUp
  375.  
  376.  
  377.  
  378.  
  379. -- part 21 (button)
  380. -- low flags: 00
  381. -- high flags: 0000
  382. -- rect: left=398 top=178 right=211 bottom=433
  383. -- title width / last selected line: 0
  384. -- icon id / first selected line: 105 / 105
  385. -- text alignment: 1
  386. -- font id: 0
  387. -- text size: 12
  388. -- style flags: 0
  389. -- line height: 16
  390. -- part name: 
  391. ----- HyperTalk script -----
  392. on mouseUp
  393.   effect
  394.   go card "Jupiter"
  395. end mouseUp
  396.  
  397.  
  398.  
  399.  
  400. -- part 22 (button)
  401. -- low flags: 00
  402. -- high flags: 0000
  403. -- rect: left=398 top=210 right=243 bottom=433
  404. -- title width / last selected line: 0
  405. -- icon id / first selected line: 106 / 106
  406. -- text alignment: 1
  407. -- font id: 0
  408. -- text size: 12
  409. -- style flags: 0
  410. -- line height: 16
  411. -- part name: 
  412. ----- HyperTalk script -----
  413. on mouseUp
  414.   effect
  415.   go card "Saturn"
  416. end mouseUp
  417.  
  418.  
  419.  
  420.  
  421. -- part 23 (button)
  422. -- low flags: 00
  423. -- high flags: 0000
  424. -- rect: left=398 top=242 right=275 bottom=433
  425. -- title width / last selected line: 0
  426. -- icon id / first selected line: 107 / 107
  427. -- text alignment: 1
  428. -- font id: 0
  429. -- text size: 12
  430. -- style flags: 0
  431. -- line height: 16
  432. -- part name: 
  433. ----- HyperTalk script -----
  434. on mouseUp
  435.   effect
  436.   go card "Uranus"
  437. end mouseUp
  438.  
  439.  
  440.  
  441.  
  442. -- part 24 (button)
  443. -- low flags: 00
  444. -- high flags: 0000
  445. -- rect: left=398 top=274 right=304 bottom=433
  446. -- title width / last selected line: 0
  447. -- icon id / first selected line: 108 / 108
  448. -- text alignment: 1
  449. -- font id: 0
  450. -- text size: 12
  451. -- style flags: 0
  452. -- line height: 16
  453. -- part name: 
  454. ----- HyperTalk script -----
  455. on mouseUp
  456.   effect
  457.   go card "Neptune"
  458. end mouseUp
  459.  
  460.  
  461.  
  462.  
  463. -- part 27 (button)
  464. -- low flags: 00
  465. -- high flags: 0004
  466. -- rect: left=231 top=306 right=340 bottom=276
  467. -- title width / last selected line: 0
  468. -- icon id / first selected line: 5472 / 5472
  469. -- text alignment: 1
  470. -- font id: 0
  471. -- text size: 12
  472. -- style flags: 0
  473. -- line height: 16
  474. -- part name: New Button
  475. ----- HyperTalk script -----
  476. on mouseUp
  477.   go first card
  478. end mouseUp
  479.  
  480.  
  481.  
  482. -- part 28 (field)
  483. -- low flags: 00
  484. -- high flags: 0000
  485. -- rect: left=39 top=25 right=44 bottom=217
  486. -- title width / last selected line: 0
  487. -- icon id / first selected line: 0 / 0
  488. -- text alignment: 0
  489. -- font id: 3
  490. -- text size: 12
  491. -- style flags: 256
  492. -- line height: 16
  493. -- part name: Date
  494.  
  495.  
  496. -- part 31 (field)
  497. -- low flags: 00
  498. -- high flags: 0000
  499. -- rect: left=266 top=25 right=44 bottom=469
  500. -- title width / last selected line: 0
  501. -- icon id / first selected line: 0 / 0
  502. -- text alignment: 0
  503. -- font id: 3
  504. -- text size: 12
  505. -- style flags: 256
  506. -- line height: 16
  507. -- part name: JD
  508.  
  509.  
  510. -- part 35 (button)
  511. -- low flags: 00
  512. -- high flags: 0000
  513. -- rect: left=358 top=50 right=85 bottom=399
  514. -- title width / last selected line: 0
  515. -- icon id / first selected line: 30979 / 30979
  516. -- text alignment: 1
  517. -- font id: 0
  518. -- text size: 12
  519. -- style flags: 0
  520. -- line height: 16
  521. -- part name: Moon
  522. ----- HyperTalk script -----
  523. on mouseUp
  524.   effect
  525.   go to card id 7837
  526. end mouseUp
  527.  
  528.  
  529.  
  530.  
  531. -- part 36 (button)
  532. -- low flags: 00
  533. -- high flags: 0002
  534. -- rect: left=475 top=50 right=80 bottom=508
  535. -- title width / last selected line: 0
  536. -- icon id / first selected line: 2478 / 2478
  537. -- text alignment: 1
  538. -- font id: 0
  539. -- text size: 12
  540. -- style flags: 0
  541. -- line height: 16
  542. -- part name: 
  543. ----- HyperTalk script -----
  544. on mouseUp
  545.   push card
  546.   go first card of bkgnd "Info"
  547. end mouseUp
  548.  
  549.  
  550.  
  551. -- part 39 (field)
  552. -- low flags: 00
  553. -- high flags: 0000
  554. -- rect: left=216 top=25 right=44 bottom=266
  555. -- title width / last selected line: 0
  556. -- icon id / first selected line: 0 / 0
  557. -- text alignment: 0
  558. -- font id: 3
  559. -- text size: 12
  560. -- style flags: 256
  561. -- line height: 16
  562. -- part name: Pct
  563.  
  564.  
  565. -- part 40 (button)
  566. -- low flags: 00
  567. -- high flags: 0000
  568. -- rect: left=432 top=120 right=157 bottom=471
  569. -- title width / last selected line: 0
  570. -- icon id / first selected line: 26516 / 26516
  571. -- text alignment: 1
  572. -- font id: 0
  573. -- text size: 12
  574. -- style flags: 0
  575. -- line height: 16
  576. -- part name: Conj
  577. ----- HyperTalk script -----
  578. on mouseUp
  579.   push cd
  580.   go cd conjunct
  581. end mouseUp
  582.  
  583.  
  584.  
  585. -- part 41 (button)
  586. -- low flags: 00
  587. -- high flags: 0000
  588. -- rect: left=432 top=156 right=191 bottom=471
  589. -- title width / last selected line: 0
  590. -- icon id / first selected line: 28557 / 28557
  591. -- text alignment: 1
  592. -- font id: 0
  593. -- text size: 12
  594. -- style flags: 0
  595. -- line height: 16
  596. -- part name: topo
  597. ----- HyperTalk script -----
  598. on mouseUp
  599.   pop cd
  600.   go position
  601. end mouseUp
  602.  
  603.  
  604.  
  605. -- part 42 (button)
  606. -- low flags: 00
  607. -- high flags: 0000
  608. -- rect: left=432 top=190 right=226 bottom=471
  609. -- title width / last selected line: 0
  610. -- icon id / first selected line: 4450 / 4450
  611. -- text alignment: 1
  612. -- font id: 0
  613. -- text size: 12
  614. -- style flags: 0
  615. -- line height: 16
  616. -- part name: meteor
  617. ----- HyperTalk script -----
  618. on mouseUp
  619.   go cd meteor
  620.   mcalc
  621. end mouseUp
  622.  
  623.  
  624.  
  625. -- part 43 (button)
  626. -- low flags: 00
  627. -- high flags: 0000
  628. -- rect: left=432 top=225 right=259 bottom=470
  629. -- title width / last selected line: 0
  630. -- icon id / first selected line: 17699 / 17699
  631. -- text alignment: 1
  632. -- font id: 0
  633. -- text size: 12
  634. -- style flags: 0
  635. -- line height: 16
  636. -- part name: ad-aa
  637. ----- HyperTalk script -----
  638. on mouseUp
  639.   go to card id 11225
  640. end mouseUp
  641.  
  642.  
  643.